package com.kepler.social.domain.support.media.consts;

public enum CallBackType {
    http(1, "http"),
    spring_ioc(2, "spring"),
    ;

    public int code;
    public String name;

    CallBackType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean exists(int code) {
        return null != getByType(code);
    }

    public static CallBackType getByType(int code) {
        for (CallBackType enum_ : values()) {
            if (enum_.getCode() == code) {
                return enum_;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
